<template>
  <div class="listItem">
    <img :src="defaultValue.url" alt="">
    <div class="name">{{defaultValue.name}}</div>
    <div class="tip" v-if="defaultValue.tip">{{defaultValue.tip}}</div>
    <div class="price">￥{{defaultValue.price}}</div>
    <div class="num">已售&nbsp;{{defaultValue.num}}&nbsp;件</div>
  </div>
</template>

<script>
export default {
  props:{
    defaultValue: {
      type: Object,
      default: () => {}
    },
  },
  created(){
    console.log(this.initVal,'pppp')
  }
}
</script>

<style lang="scss" scoped>
  .listItem{
    width: 15vw;
    height: 339px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    img{
      height: 230px;
      width: 100%;
    }
    div{
      padding: 5px 10px;
      font-size: 14px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .name{
      width: calc(100% - 20px);
    }
    .tip{
      color: #FF734C;
      border: 1px solid #ff734c;
      display: inline-block;
      padding: 0 10px;
      margin-top: 4px;
      background: #FFF0EC;
      border-radius: 20px;
    }
    .price{
      font-weight: bold;
    }
    .num{
      font-size: 12px;
    }
  }
</style>